package com.people.whx.demo.controller;


import com.people.whx.demo.rabbitmq.Sender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/rabbitmq")
public class RabbitmqController {

    @Autowired
    private Sender sender;

    @RequestMapping("/hello")
    public String test(){
        return "hello";
    }

    @RequestMapping("/sendMessage")
    public String send(){
        sender.sendPlainMessage("this is a message from sender");
        return "send message success";
    }


}
